<?
$tempo = floor(time() - $pers->getValue('ultimo_acesso');
$pers->setValue('ultimo_acesso', floor(time()));

if ($pers->getValue('hp') + floor($tempo / 20) <= $pers->getValue('hp_max'))
	$pers->setValue('hp', $pers->getValue('hp') + floor($tempo / 20));
else $pers->setValue('hp', $pers->getValue('hp_max'));

if ($pers->getValue('nonLethalDamage') - floor($tempo / 5) >= 0)
	$pers->setValue('nonLethalDamage', $pers->getValue('nonLethalDamage') - floor($tempo / 5));
else $pers->setValue('nonLethalDamage', 0);

$pers->actualizar();
?>